package org.gw.building.repositories;

import org.gw.building.model.Yx;
import org.gw.building.model.YxBm;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

/**
 * Created by qwx89 on 2017/8/12.
 */
public interface YxBmRepository extends CrudRepository<YxBm,String> {

    List<YxBm> findByYx(Yx yx);

    @Query("delete from YxBm t where t.yx =?1")
    @Modifying
    void deleteByYx(Yx yx);
}
